<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!-- Viewport-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no" />
    <!-- SEO Meta Tags-->
    <meta name="keywords" content="quicky, chat, messenger, conversation, social, communication" />
    <meta name="description" content="Quicky is a Bootstrap based modern and fully responsive Messaging template to help build Messaging or Chat application fast and easy." />
    <meta name="subject" content="communication">
    <meta name="copyright" content="frontendmatters">
    <meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm" />
    <title>{:$configs['SYSTEM_NAME']}</title>
    <!-- Favicon and Touch Icons-->
    <link rel="apple-touch-icon" sizes="180x180" href="./../apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="./../favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="./../favicon-16x16.png">
    <link rel="shortcut icon" href="./../favicon.ico" />
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="theme-color" content="#ffffff">
    <link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/bootstrap.min.css">
    <link rel="stylesheet" href="__STATIC__/index/webfonts/inter/inter.css"> 
    <link rel="stylesheet" href="__STATIC__/index/css/app.min.css">
    
</head>

<body class="chats-tab-open">

    <!-- Main Layout Start -->
    <div class="main-layout">
        <!-- Navigation Start -->
        {include file="html/menu" /}
        <!-- Navigation End -->

        <!-- Sidebar Start -->
        {include file="html/session" /}
        <!-- Sidebar End -->

        <!-- Main Start -->
        <main class="main">

            <!-- Chats Page Start -->
            <div class="chats" id="msgChats" style="display:none;">
                <!-- Chat Body Start -->
                <div class="chat-body">

                    <!-- Chat Header Start-->
                    <div class="chat-header">
                        <!-- Chat Back Button (Visible only in Small Devices) -->
                        <button class="btn btn-secondary btn-icon btn-minimal btn-sm d-xl-none" type="button" data-close="">
                            <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
                            </svg>
                            <!-- <img class="injectable hw-20" src="./../assets/media/heroicons/outline/arrow-left.svg" alt=""> -->
                        </button>

                        <!-- Chat participant's Name -->
                        <div class="media chat-name align-items-center text-truncate">
                            <div class="avatar bg-success text-light d-none d-sm-inline-block mr-3">
                                <span>
                                    <img class="injectable" src="./../assets/media/heroicons/outline/user-group.svg" alt="">
                                </span>
                            </div>

                            <div class="media-body align-self-center ">
                                <h6 class="text-truncate mb-0">Themeforest Group</h6>
                                <small class="text-muted">252 Participants</small>
                            </div>
                        </div>

                        <!-- Chat Options -->
                        <ul class="nav flex-nowrap">
                            <!-- <li class="nav-item list-inline-item d-none d-sm-block mr-1">
                                <a class="nav-link text-muted px-1" data-toggle="collapse" data-target="#searchCollapse" href="#" aria-expanded="false">
                                    <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                                    </svg>
                                </a>
                            </li> -->

                            <!-- <li class="nav-item list-inline-item d-none d-sm-block mr-1">
                                <a class="nav-link text-muted px-1" href="#" title="Add People">
                                    <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
                                    </svg>
                                </a>
                            </li> -->
                            <li class="nav-item list-inline-item d-none d-sm-block mr-0">
                                <div class="dropdown">
                                    <a class="nav-link text-muted px-1" href="#" role="button" title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"/>
                                        </svg>
                                        <!-- <img src="./../assets/media/heroicons/outline/dots-vertical.svg" alt="" class="injectable hw-20"> -->
                                    </a>

                                    <div class="dropdown-menu dropdown-menu-right">
                                        <!-- <a class="dropdown-item align-items-center d-flex" href="#" data-chat-info-toggle="">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                            </svg>
                                              
                                            <span>View Info</span>
                                        </a>

                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" clip-rule="evenodd"/>
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"/>
                                              </svg>
                                            <span>Mute Notifications</span> 
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                              </svg>
                                            <span>Wallpaper</span>
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"/>
                                              </svg>
                                              
                                            <span>Archive</span>
                                        </a> -->
                                        <a class="dropdown-item align-items-center d-flex" href="javascript:void(0)" onclick="deleteSession()">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
                                              </svg>
                                              
                                            <span>删除</span>
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex text-danger" href="javascript:void(0)" onclick="clearSession()">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/>
                                              </svg>
                                            <span>清空</span>
                                        </a>
                                    </div>
                                </div>
                            </li>
                            <li class="nav-item list-inline-item d-sm-none mr-0">
                                <div class="dropdown">
                                    <a class="nav-link text-muted px-1" href="#" role="button" title="Details" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                        <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"/>
                                        </svg>
                                        <!-- <img src="./../assets/media/heroicons/outline/dots-vertical.svg" alt="" class="injectable hw-20"> -->
                                    </a>

                                    <div class="dropdown-menu dropdown-menu-right">
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"/>
                                              </svg>
                                            <!-- <img src="./../assets/media/heroicons/outline/phone.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Call</span>    
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex" href="#" data-toggle="collapse" data-target="#searchCollapse" aria-expanded="false">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                                            </svg>
                                            <!-- <img src="./../assets/media/heroicons/outline/search.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Search</span>    
                                        </a>
                                        
                                        <a class="dropdown-item align-items-center d-flex" href="#" data-chat-info-toggle="">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                            </svg>
                                              
                                            <!-- <img src="./../assets/media/heroicons/outline/information-circle.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>View Info</span>
                                        </a>
                                        
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z" clip-rule="evenodd"/>
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2"/>
                                            </svg>
                                            <!-- <img src="./../assets/media/heroicons/outline/volume-off.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Mute Notifications</span> 
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                            </svg>
                                            <!-- <img src="./../assets/media/heroicons/outline/photograph.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Wallpaper</span>
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"/>
                                            </svg>
                                            <!-- <img src="./../assets/media/heroicons/outline/archive.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Archive</span>
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
                                            </svg>
                                              
                                            <!-- <img src="./../assets/media/heroicons/outline/trash.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Delete</span>
                                        </a>
                                        <a class="dropdown-item align-items-center d-flex text-danger" href="#">
                                            <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"/>
                                            </svg>
                                              
                                            <!-- <img src="./../assets/media/heroicons/outline/ban.svg" alt="" class="injectable hw-20 mr-2"> -->
                                            <span>Block</span>
                                        </a>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <!-- Chat Header End-->

                    <!-- Search Start -->
                    <div class="collapse border-bottom px-3" id="searchCollapse">
                        <div class="container-xl py-2 px-0 px-md-3">
                            <div class="input-group bg-light ">
                                <input type="text" class="form-control form-control-md border-right-0 bg-transparent pr-0" placeholder="Search...">
                                <div class="input-group-append">
                                    <span class="input-group-text bg-transparent border-left-0">
                                        <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                                          </svg>
                                          
                                        <!-- <img class="injectable hw-20" src="./../assets/media/heroicons/outline/search.svg" alt="Search icon"> -->
                                    </span>
                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <!-- Search End -->

                    <!-- Chat Content Start-->
                    <div class="chat-content p-2">
                        <div class="container" id="chatContent">

                            <!-- Message Day Start -->
                            <div class="message-day">

                                <div class="message-divider sticky-top pb-2" data-label="Yesterday">&nbsp;</div>

                                <!-- Received Message Start -->
                                <div class="message self">
                                    <div class="message-wrapper">
                                        <div class="message-content">
                                            <span>Wow!  Today is October 30th! Halloween is tomorrow already!  Have you decided what you will be dressing up for Halloween yet, Sara?</span>
                                        </div>
                                    </div>
                                    <div class="message-options">
                                        <div class="avatar avatar-sm"><img alt="" src="./../assets/media/avatar/1.png"></div>
                                        <span class="message-date">9:12am</span>
                                        <div class="dropdown">
                                            <a class="text-muted" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-18" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"/>
                                                </svg>
                                            </a>
        
                                            <div class="dropdown-menu">
                                                <a class="dropdown-item d-flex align-items-center" href="#">
                                                    <svg class="hw-18 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"/>
                                                    </svg>
                                                    <span>Copy</span>
                                                </a>
                                                <a class="dropdown-item d-flex align-items-center text-danger" href="#">
                                                    <svg class="hw-18 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
                                                    </svg>
                                                    <span>Delete</span>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <!-- Received Message End -->

                            </div>
                            <!-- Message Day End -->

                       

                        </div>

                        <!-- Scroll to finish -->
                        <div class="chat-finished" id="chat-finished"></div>
                    </div>
                    <!-- Chat Content End-->


                    <!-- Chat Footer Start-->
                    <div class="chat-footer">
                        <form>
                            <div class="form-row">
                                <!-- Chat Input Group Start -->
                                <div class="col">
                                    <div class="input-group">
                                        <!-- Attachment Start -->
                                        <div class="input-group-prepend mr-sm-2 mr-1" style="display:none;">
                                            <div class="dropdown">
                                                <button class="btn btn-secondary btn-icon btn-minimal btn-sm" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                    <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                                    </svg>
                                                      
                                                    <!-- <img class="injectable hw-20" src="./../assets/media/heroicons/outline/plus-circle.svg" alt=""> -->
                                                </button>
                                                <div class="dropdown-menu">
                                                    <a class="dropdown-item" href="#">
                                                        <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                                        </svg>
                                                        <!-- <img class="injectable hw-20 mr-2" src="./../assets/media/heroicons/outline/photograph.svg" alt=""> -->
                                                        <span>Gallery</span>
                                                    </a>
                                                    <a class="dropdown-item" href="#">
                                                        <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z"/>
                                                        </svg>
                                                          
                                                        <!-- <img class="injectable hw-20 mr-2" src="./../assets/media/heroicons/outline/volume-up.svg" alt=""> -->
                                                        <span>Audio</span>
                                                    </a>
                                                    <a class="dropdown-item" href="#">
                                                        <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"/>
                                                        </svg>
                                                          
                                                        <!-- <img class="injectable hw-20 mr-2" src="./../assets/media/heroicons/outline/document.svg" alt=""> -->
                                                        <span>Document</span>
                                                    </a>
                                                    <a class="dropdown-item" href="#">
                                                        <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
                                                        </svg>
                                                          
                                                        <!-- <img class="injectable hw-20 mr-2" src="./../assets/media/heroicons/outline/user.svg" alt=""> -->
                                                        <span>Contact</span>
                                                    </a>
                                                    <a class="dropdown-item" href="#">
                                                        <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"/>
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"/>
                                                        </svg>
                                                          
                                                        <!-- <img class="injectable hw-20 mr-2" src="./../assets/media/heroicons/outline/location-marker.svg" alt=""> -->
                                                        <span>Location</span>
                                                    </a>
                                                    <a class="dropdown-item" href="#">
                                                        <svg class="hw-20 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                                        </svg>
                                                          
                                                        <!-- <img class="injectable hw-20 mr-2" src="./../assets/media/heroicons/outline/chart-square-bar.svg" alt=""> -->
                                                        <span>Poll</span>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                        <!-- Attachment End -->
                                
                                        <!-- Emoji Start -->
                                        <!-- <div class="input-group-prepend mr-sm-2 mr-1">
                                            <button class="btn btn-secondary btn-icon btn-minimal btn-sm" type="button">
                                                <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                                </svg>
                                            </button>
                                        </div> -->
                                        <!-- Emoji End -->

                                        <!-- Textarea Start-->
                                        <textarea class="form-control bg-transparent border-0 no-resize hide-scrollbar" id="msg_text" placeholder="请输入你的内容" rows="1"></textarea>
                                        <!-- Textarea End -->
                                    </div>
                                </div>
                                <!-- Chat Input Group End -->
                        
                                <!-- Submit Button Start -->
                                <div class="col-auto">
                                    <div class="btn btn-primary btn-icon rounded-circle text-light mb-1" role="button" onclick="sendMsg()">
                                        <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3"/>
                                        </svg>
                                          
                                        <!-- <img src="./../assets/media/heroicons/outline/arrow-right.svg" alt="" class="injectable"> -->
                                    </div>
                                </div>
                                <!-- Submit Button End-->
                            </div>
                        </form>
                    </div>
                    <!-- Chat Footer End-->
                </div>
                <!-- Chat Body End -->

            </div>
            <!-- Chats Page End -->

            <!-- Chats Page Start -->
            <div class="chats" id="initChats">
                <div class="d-flex flex-column justify-content-center text-center h-100 w-100">
                    <div class="container">
                        <div class="avatar avatar-lg mb-2">
                            <img class="avatar-img" src="__UPLOAD__/{:$configs['SYSTEM_ICON']}" alt="">
                        </div>

                        <h5>你好，我是{:$configs['SYSTEM_NAME']}！</h5>
                        <p class="text-muted">{:myTextareaShow($configs['SYSTEM_TXT'])}</p>

                        <button class="btn btn-outline-primary no-box-shadow" type="button" data-toggle="modal" data-target="#startConversation">
                            创建新的对话
                        </button>
                    </div>
                </div>
            </div>
            <!-- Chats Page End -->



            <!-- Profile Settings Start -->
            <div class="profile">
                <div class="page-main-heading sticky-top py-2 px-3 mb-3">

                    <!-- Chat Back Button (Visible only in Small Devices) -->
                    <button class="btn btn-secondary btn-icon btn-minimal btn-sm text-muted d-xl-none" type="button" data-close="">
                        <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
                          </svg>
                        <!-- <img class="injectable hw-20" src="__STATIC__/index/media/heroicons/outline/arrow-left.svg" alt=""> -->
                    </button>

                    <div class="pl-2 pl-xl-0">
                        <h5 class="font-weight-semibold">设置</h5>
                        <p class="text-muted mb-0">更新个人信息 &amp; 设置</p>
                    </div>
                </div>

                <div class="container-xl px-2 px-sm-3">
                    <div class="row">
                        <div class="col">
                            <div class="card mb-3">
                                <div class="card-header">
                                    <h6 class="mb-1">账号信息</h6>
                                    <p class="mb-0 text-muted small">更新个人信息</p>
                                </div>
                                
                                <div class="card-body">
                                    <form id="profile_form">
                                        <div class="row">
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="nickname">昵称</label>
                                                    <input type="text" class="form-control form-control-md" id="nickname" name="nickname" placeholder="请输入您的昵称" value="">
                                                </div>
                                            </div>

                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="truename">姓名</label>
                                                    <input type="text" class="form-control form-control-md" id="truename" name="truename" placeholder="请输入您的姓名" value="">
                                                </div>
                                            </div>
                                         
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="mobile">手机号码</label>
                                                    <input type="text" class="form-control form-control-md" id="mobile" name="mobile" placeholder="请输入您的手机号码" value="" disabled>
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="birthday">生日</label>
                                                    <input type="text" class="form-control form-control-md" id="birthday" name="birthday" placeholder="请输入您的生日" value="">
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="email">Email</label>
                                                    <input type="email" class="form-control form-control-md" id="email" name="email" placeholder="请输入您的邮箱地址" value="">
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="company">公司名称</label>
                                                    <input type="text" class="form-control form-control-md" id="company" name="company" placeholder="请输入您的公司名称" value="">
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <div class="form-group">
                                                    <label for="signature">个性签名</label>
                                                    <input type="text" class="form-control form-control-md" id="signature" name="signature" placeholder="个性签名" value="">
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>

                                <div class="card-footer d-flex justify-content-end">
                                    <!-- <button type="button" class="btn btn-link text-muted mx-1">Reset</button> -->
                                    <button type="button" class="btn btn-primary profile_btn">保 存</button>
                                </div>
                            </div>

                            <div class="card mb-3">
                                <div class="card-header">
                                    <h6 class="mb-1">密码</h6>
                                    <p class="mb-0 text-muted small">重置密码</p>
                                </div>
                                
                                <div class="card-body">
                                    <form id="pwd_form">
                                        <div class="row">
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="current-password">当前密码</label>
                                                    <input type="password" class="form-control form-control-md" id="current-password" placeholder="Current password" name="old_pwd" autocomplete="on">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="new-password">新密码</label>
                                                    <input type="password" class="form-control form-control-md" id="new-password" placeholder="New password" autocomplete="off" name="new_pwd">
                                                </div>
                                            </div>
                                            <div class="col-md-6 col-12">
                                                <div class="form-group">
                                                    <label for="repeat-password">确认密码</label>
                                                    <input type="password" class="form-control form-control-md" id="repeat-password" placeholder="Repeat password" autocomplete="off" name="confirm_pwd">
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>

                                <div class="card-footer d-flex justify-content-end">
                                    <!-- <button type="button" class="btn btn-link text-muted mx-1">Reset</button> -->
                                    <button type="button" class="btn btn-primary pwd_btn">保 存</button>
                                </div>
                            </div>

                       
                        </div>
                    </div>
                </div>
            </div>
            <!-- Profile Settings End -->

        </main>
        <!-- Main End -->

        <!-- All Modals Start -->

        <!-- Modal 1 :: Start a Conversation-->
        <div class="modal modal-lg-fullscreen fade" id="startConversation" tabindex="-1" role="dialog" aria-labelledby="startConversationLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
                <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="startConversationLabel">新建对话</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body p-0 hide-scrollbar">
                    <div class="row">
                   

                        <div class="col-12">
                                <!-- List Group Start -->
                                <ul class="list-group list-group-flush">

                                <?php foreach ($assistants as $k => $vo): ?>
                                <!-- List Group Item Start -->
                                <li class="list-group-item" data-dismiss="modal">
                                    <div class="media">
                                        <div class="avatar avatar-online mr-2">
                                            <img src="__UPLOAD__/{:$vo['image']}" alt="">
                                        </div>

                                        <div class="media-body">
                                            <h6 class="text-truncate">
                                                <a href="javascript:void(0);" onclick="createSession('{:$vo["id"]}')" class="text-reset">{:$vo['name']}</a>
                                            </h6>

                                            <p class="text-muted mb-0">Online</p>
                                        </div>
                                    </div>
                                </li>
                                <!-- List Group Item End -->
                                <?php endforeach ?>


                            </ul>
                            <!-- List Group End -->
                        </div>
                    </div>
                </div>
                </div>
            </div>
        </div>

        <!-- Modal 2 :: Create Group -->
        <div class="modal modal-lg-fullscreen fade" id="createGroup" tabindex="-1" role="dialog" aria-labelledby="createGroupLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title js-title-step" id="createGroupLabel">&nbsp;</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body py-0 hide-scrollbar">
                        <div class="row hide pt-2" data-step="1" data-title="Create a New Group">
                            
                            <div class="col-12">
                                <div class="form-group">
                                    <label for="groupName">Group name</label>
                                    <input type="text" class="form-control form-control-md" id="groupName" placeholder="Type group name here">
                                </div>
                            </div>
                            <div class="col-12">
                                <div class="form-group">
                                    <label>Choose profile picture</label>
                                    <div class="custom-file">
                                        <input type="file" class="custom-file-input" id="profilePictureInput" accept="image/*">
                                        <label class="custom-file-label" for="profilePictureInput">Choose file</label>
                                        </div>
                                </div>
                            </div>

                            <div class="col-12">
                                <div class="row">
                                    <div class="col-12">
                                        <div class="form-group mb-0">
                                        <label>Group privacy</label>
                                        </div>
                                    </div>
                                    <div class="col">
                                        <div class="form-group rounded p-2 border">
                                        <div class="custom-control custom-radio">
                                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios1" value="option1" checked>
                                            <label class="form-check-label" for="exampleRadios1">
                                                Public group
                                            </label>
                                        </div>
                                        </div>
                                    </div>
                                    <div class="col">
                                        <div class="form-group rounded p-2 border">
                                        <div class="custom-control custom-radio">
                                            <input class="form-check-input" type="radio" name="exampleRadios" id="exampleRadios2" value="option2">
                                            <label class="form-check-label" for="exampleRadios2">
                                                Private group
                                            </label>
                                        </div>
                                        </div>
                                    </div>
                                    </div>
                            </div>
                        
                        </div>

                        <div class="row hide pt-2" data-step="2" data-title="Add Group Members">
                            <div class="col-12 px-0">
                                <!-- Search Start -->
                                <form class="form-inline w-100 px-2 pb-2 border-bottom">
                                    <div class="input-group w-100 bg-light">
                                        <input type="text" class="form-control form-control-md search border-right-0 transparent-bg pr-0" placeholder="Search...">
                                        <div class="input-group-append">
                                            <div class="input-group-text transparent-bg border-left-0" role="button">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                                                </svg>   

                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-20" src="__STATIC__/index/media/heroicons/outline/search.svg" alt=""> -->
                                            </div>
                                        </div>
                                    </div>
                                </form>
                                <!-- Search End -->
                            </div>
    
                            <div class="col-12 px-0">
                                <!-- List Group Start -->
                                <ul class="list-group list-group-flush">
    
                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="avatar avatar-online mr-2">
                                                <img src="__STATIC__/index/media/avatar/1.png" alt="">
                                            </div>
    
                                            <div class="media-body">
                                                <h6 class="text-truncate">
                                                    <a href="#" class="text-reset">Catherine Richardson</a>
                                                </h6>
    
                                                <p class="text-muted mb-0">Online</p>
                                            </div>

                                            <div class="media-options">
                                                <div class="custom-control custom-checkbox">
                                                    <input class="custom-control-input" type="checkbox" value="" id="chx-user-1" checked="">
                                                    <label class="custom-control-label" for="chx-user-1"></label>
                                                </div>
                                            </div>
                                        </div>
                                        <label class="media-label" for="chx-user-1"></label>
                                    </li>
                                    <!-- List Group Item End -->
    
                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="avatar avatar-online mr-2">
                                                <img src="__STATIC__/index/media/avatar/2.png" alt="">
                                            </div>
    
                                            <div class="media-body">
                                                <h6 class="text-truncate">
                                                    <a href="#" class="text-reset">Katherine Schneider</a>
                                                </h6>
    
                                                <p class="text-muted mb-0">Online</p>
                                            </div>

                                            <div class="media-options">
                                                <div class="custom-control custom-checkbox">
                                                    <input class="custom-control-input" type="checkbox" value="" id="chx-user-2" checked="">
                                                    <label class="custom-control-label" for="chx-user-2"></label>
                                                </div>
                                            </div>
                                        </div>
                                        <label class="media-label" for="chx-user-2"></label>
                                    </li>
                                    <!-- List Group Item End -->
    
                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="avatar avatar-offline mr-2">
                                                <img src="__STATIC__/index/media/avatar/3.png" alt="">
                                            </div>
    
                                            <div class="media-body">
                                                <h6 class="text-truncate">
                                                    <a href="#" class="text-reset">Brittany K. Williams</a>
                                                </h6>
    
                                                <p class="text-muted mb-0">Offline</p>
                                            </div>
                                            <div class="media-options">
                                                <div class="custom-control custom-checkbox">
                                                    <input class="custom-control-input" type="checkbox" value="" id="chx-user-3">
                                                    <label class="custom-control-label" for="chx-user-3"></label>
                                                </div>
                                            </div>
                                        </div>
                                        <label class="media-label" for="chx-user-3"></label>
                                    </li>
                                    <!-- List Group Item End -->
    
                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="avatar avatar-busy mr-2">
                                                <img src="__STATIC__/index/media/avatar/4.png" alt="">
                                            </div>
                                            <div class="media-body">
                                                <h6 class="text-truncate"><a href="#" class="text-reset">Christina Turner</a></h6>
                                                <p class="text-muted mb-0">Busy</p>
                                            </div>
                                            <div class="media-options">
                                                <div class="custom-control custom-checkbox">
                                                    <input class="custom-control-input" type="checkbox" value="" id="chx-user-4" checked="">
                                                    <label class="custom-control-label" for="chx-user-4"></label>
                                                </div>
                                            </div>
                                        </div>
                                        <label class="media-label" for="chx-user-4"></label>
                                    </li>
                                    <!-- List Group Item End -->
    
                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="avatar avatar-away mr-2">
                                                <img src="__STATIC__/index/media/avatar/5.png" alt="">
                                            </div>
    
                                            <div class="media-body">
                                                <h6 class="text-truncate"><a href="#" class="text-reset">Annie Richardson</a></h6>
                                                <p class="text-muted mb-0">Away</p>
                                            </div>
                                            <div class="media-options">
                                                <div class="custom-control custom-checkbox">
                                                    <input class="custom-control-input" type="checkbox" value="" id="chx-user-5">
                                                    <label class="custom-control-label" for="chx-user-5"></label>
                                                </div>
                                            </div>
                                        </div>
                                        <label class="media-label" for="chx-user-5"></label>
                                    </li>
                                    <!-- List Group Item End -->
    
                                </ul>
                                <!-- List Group End -->
                            </div>
                        </div>

                        <div class="row pt-2 h-100 hide" data-step="3" data-title="Finished">
                            <div class="col-12">
                                <div class="d-flex justify-content-center align-items-center flex-column h-100">
                                    <div class="btn btn-success btn-icon rounded-circle text-light mb-3">
                                        <!-- Default :: Inline SVG -->
                                        <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/>
                                        </svg>
                                            
                                        <!-- Alternate :: External File link -->
                                        <!-- <img class="injectable hw-24" src="__STATIC__/index/media/heroicons/outline/check.svg" alt=""> -->
                                    </div>
                                    <h6>Group Created Successfully</h6>
                                    <p class="text-muted text-center">Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolores cumque laborum fugiat vero pariatur provident!</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-link text-muted js-btn-step mr-auto" data-orientation="cancel" data-dismiss="modal"></button>
                        <button type="button" class="btn btn-secondary  js-btn-step" data-orientation="previous"></button>
                        <button type="button" class="btn btn-primary js-btn-step" data-orientation="next"></button>
                    </div>
                </div>
            </div>
        </div>

        <!-- Modal 3 :: Invite Others -->
        <div class="modal modal-lg-fullscreen fade" id="inviteOthers" tabindex="-1" role="dialog" aria-labelledby="inviteOthersLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="inviteOthersLabel">Invite Others</h5>
                        
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body hide-scrollbar">
                        <form>
                            <div class="row">
                                <div class="col-12">
                                    <div class="form-group">
                                        <label for="inviteEmailAddress">Email address</label>
                                        <input type="email" class="form-control form-control-md" id="inviteEmailAddress" placeholder="Type email address here" value="">
                                    </div>
                                </div>
                                <div class="col-12">
                                    <div class="form-group">
                                        <label for="inviteMessage">Invitation message</label>
                                        <textarea class="form-control form-control-md no-resize hide-scrollbar" id="inviteMessage" placeholder="Write your message here" rows="3"></textarea>
                                    </div>
                                </div>
                            </div>
                        </form>
                        
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-link text-muted" data-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Send Invitation</button>
                        </div>
                </div>
            </div>
        </div>
                
        <!-- Modal 4 :: Notifications -->
        <div class="modal modal-lg-fullscreen fade" id="notificationModal" tabindex="-1" role="dialog" aria-labelledby="notificationModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="notificationModalLabel">Notifications</h5>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body p-0 hide-scrollbar">
                        <div class="row">

                            <div class="col-12">
                                    <!-- List Group Start -->
                                    <ul class="list-group list-group-flush  py-2">

                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="btn btn-primary btn-icon rounded-circle text-light mr-2">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-24" src="__STATIC__/index/media/heroicons/outline/user-add.svg" alt=""> -->
                                            </div>

                                            <div class="media-body">
                                                <h6>
                                                    <a href="#">Catherine richardson</a> send you a friend request
                                                </h6>

                                                <p class="text-muted mb-0">5 mins ago</p>
                                            </div>
                                        </div>
                                        <div class="d-flex justify-content-center mt-2">
                                            <button type="button" class="btn btn-outline-danger mx-1">Reject</button>
                                            <button type="button" class="btn btn-primary mx-1">Accept</button>
                                        </div>

                                    </li>
                                    <!-- List Group Item End -->

                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="btn btn-primary btn-icon rounded-circle text-light mr-2">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-24" src="__STATIC__/index/media/heroicons/outline/check-circle.svg" alt=""> -->
                                            </div>

                                            <div class="media-body">
                                                <h6>
                                                    <a href="#">Katelyn Valdez</a> accepted your friend request
                                                </h6>

                                                <p class="text-muted mb-0">25 mins ago</p>
                                            </div>
                                        </div>
                                    </li>
                                    <!-- List Group Item End -->

                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="btn btn-primary btn-icon rounded-circle text-light mr-2">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                                </svg>

                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-24" src="__STATIC__/index/media/heroicons/outline/photograph.svg" alt=""> -->
                                            </div>

                                            <div class="media-body">
                                                <h6>
                                                    <a href="#">Eva Walker</a> updated profile picture
                                                </h6>

                                                <p class="text-muted mb-0">5 mins ago</p>
                                            </div>
                                        </div>
                                    </li>
                                    <!-- List Group Item End -->

                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="btn btn-primary btn-icon rounded-circle text-light mr-2">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                                </svg>
                                                    
                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-24" src="__STATIC__/index/media/heroicons/outline/check-circle.svg" alt=""> -->
                                            </div>

                                            <div class="media-body">
                                                <h6>
                                                    <a href="#">Bonnie Torres</a> accepted your friend request
                                                </h6>

                                                <p class="text-muted mb-0">5 mins ago</p>
                                            </div>
                                        </div>
                                    </li>
                                    <!-- List Group Item End -->

                                    <!-- List Group Item Start -->
                                    <li class="list-group-item">
                                        <div class="media">
                                            <div class="btn btn-primary btn-icon rounded-circle text-light mr-2">
                                                <!-- Default :: Inline SVG -->
                                                <svg class="hw-24" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"/>
                                                </svg>

                                                <!-- Alternate :: External File link -->
                                                <!-- <img class="injectable hw-24" src="__STATIC__/index/media/heroicons/outline/photograph.svg" alt=""> -->
                                            </div>

                                            <div class="media-body">
                                                <h6>
                                                    <a href="#">Christopher Garcia</a> updated profile picture
                                                </h6>

                                                <p class="text-muted mb-0">5 mins ago</p>
                                            </div>
                                        </div>
                                    </li>
                                    <!-- List Group Item End -->


                                </ul>
                                <!-- List Group End -->
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer justify-content-center">
                        <button type="button" class="btn btn-link text-muted">Clear all</button>
                    </div>
                </div>
            </div>
        </div>

        <!-- All Modals End -->
    </div>
    <!-- Main Layout End -->
  

    <!-- Javascript Files -->
    <script src="__STATIC__/index/vendors/jquery/jquery-3.5.0.min.js"></script>
    <script src="__STATIC__/index/vendors/bootstrap/bootstrap.bundle.min.js"></script>
    <script src="__STATIC__/index/vendors/magnific-popup/jquery.magnific-popup.min.js"></script>
    <script src="__STATIC__/index/vendors/svg-inject/svg-inject.min.js"></script>
    <script src="__STATIC__/index/vendors/modal-stepes/modal-steps.min.js"></script>
    <script src="__STATIC__/index/js/app.min.js"></script>

    <script type="text/javascript" src="__STATIC__/common/clipboard.min.js"></script>
    <script src="__STATIC__/common/cch.js"></script>
    <script type="text/javascript" src="__STATIC__/common/cch-util.js"></script>

    

    <script type="text/javascript">
        $(function(){

            showUinfo();

            $(".profile_btn").on('click',function(){
                var params = $("#profile_form").serialize();
                $.ajax({
                    url:'{:url("user/update")}',
                    data:params,
                    type:'post',
                    dataType:'json',
                    success:function(data){
                      console.log(data)
                      if (data.code == '2000') {
                        cchUtil.message('更新成功');
                        showUinfo();
                      }else{
                        cchUtil.message(data.msg,'danger');
                      }
                    }
                });
            });

            $(".pwd_btn").on('click',function(){
                var params = $("#pwd_form").serialize();
                $.ajax({
                    url:'{:url("user/changePwd")}',
                    data:params,
                    type:'post',
                    dataType:'json',
                    success:function(data){
                      console.log(data)
                      if (data.code == '2000') {
                        cchUtil.message('更新成功');
                        showUinfo();
                      }else{
                        cchUtil.message(data.msg,'danger');
                      }
                    }
                });
            });
        });

        var global_assistant = null;
        // 创建一个新的session
        function createSession(assistant_id){
            $.ajax({
                url:'{:url("session/save")}',
                data:{assistant_id:assistant_id},
                type:'post',
                dataType:'json',
                success:function(data){
                    var str = '<li class="contacts-item friends" onclick="openChat(this)" data-sn="'+data.session_sn+'">'+
                            '<a class="contacts-link" href="javascript:void(0);">'+
                                '<div class="avatar avatar-online">'+
                                    '<img src="__UPLOAD__/'+data.assistant.image+'" alt="">'+
                                '</div>'+
                                '<div class="contacts-content">'+
                                    '<div class="contacts-info">'+
                                        '<h6 class="chat-name text-truncate">'+data.assistant.name+'</h6>'+
                                        '<div class="chat-time">'+data.msg.ctime+'</div>'+
                                    '</div>'+
                                    '<div class="contacts-texts">'+
                                        '<p class="text-truncate">'+data.msg.message+'</p>'+
                                    '</div>'+
                                '</div>'+
                            '</a>'+
                        '</li>';
                    $("#chatContactTab").prepend(str);
                    $($("#chatContactTab").find('li')[0]).trigger('click');
                }
            });
        }

        function deleteSession(){
            if (!confirm('确定删除？')) {
                return false;
            }
            $.ajax({
                url:'{:url("session/delete")}',
                data:{session_sn:global_assistant.session_sn},
                type:'post',
                dataType:'json',
                success:function(data){
                    if (data.code == 2000) {
                        cchUtil.message('删除成功');
                        $("#chatContactTab .contacts-item.active").remove();
                        $("#initChats").show();
                        $("#msgChats").hide();
                    }else{
                        cchUtil.message(data.msg,'danger');
                    }
                }
            });
        }

        function clearSession(){
            if (!confirm('确定清空？')) {
                return false;
            }
            $.ajax({
                url:'{:url("session/clear")}',
                data:{session_sn:global_assistant.session_sn},
                type:'post',
                dataType:'json',
                success:function(data){
                    if (data.code == 2000) {
                        cchUtil.message('清除成功');
                        $("#chatContactTab .contacts-item.active").trigger('click');
                    }else{
                        cchUtil.message(data.msg,'danger');
                    }
                }
            });
        }
        

        // 打开对话
        function openChat(btn){
            $("#chatContactTab .contacts-item").removeClass('active');
            $(btn).addClass('active');
            var session_sn = $(btn).attr('data-sn');

            $("#initChats").hide();
            $("#msgChats").show();

            $.ajax({
                url:'{:url("msg/index")}',
                data:{session_sn:session_sn},
                type:'post',
                dataType:'json',
                success:function(response){
                    global_assistant = response.assistant;
                    global_assistant.session_sn = session_sn;
                    renewAssistant();

                    var list = response.list;
                    var str = '';
                    for(var i in list){
                        str += '<div class="message-day">';
                        str += '<div class="message-divider sticky-top pb-2" data-label="'+i+'">&nbsp;</div>';
                                
                        for (var j in list[i]) {
                            var data = list[i][j];
                            str += createMsgHtml(data.message,0,data.ctime);
                            str += createMsgHtml(data.reply,1,data.rtime);
                        }
                        str += '</div>';
                    }
                    $("#chatContent").html(str);
                    scrollBottom();
                }
            });
        }

        // 生成对话HTML
        function createMsgHtml(message,type,ctime){
            if (ctime == null || ctime == '') {
                ctime = getFamtterHours();
            }
            if (type == 0) {
                var msg_class = 'message self';
                var avatar = '__UPLOAD__/{:$login_user['headimgurl']}';
            }else if(type == 1){
                var msg_class = 'message';
                var avatar = '__UPLOAD__/'+global_assistant.image;
            }else{
                var msg_class = 'message msg_loading';
                var avatar = '__UPLOAD__/'+global_assistant.image;
            }

            var str = '<div class="'+msg_class+'">'+
                        '<div class="message-wrapper">'+
                            '<div class="message-content">'+
                                '<span>'+message+'</span>'+
                            '</div>'+
                        '</div>'+
                        '<div class="message-options">'+
                            '<div class="avatar avatar-sm"><img alt="" src="'+avatar+'" onerror="this.src=\'__STATIC__/index/media/avatar/3.png\'"></div>'+
                            '<span class="message-date">'+ctime+'</span>'+
                            '<div class="dropdown">'+
                                '<a class="text-muted" href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">'+
                                    '<svg class="hw-18" fill="none" viewBox="0 0 24 24" stroke="currentColor">'+
                                        '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"/>'+
                                    '</svg>'+
                                '</a>'+

                                '<div class="dropdown-menu">'+
                                    '<a class="dropdown-item d-flex align-items-center copy_btn" href="javascript:void(0)" data-clipboard-text="'+message+'">'+
                                        '<svg class="hw-18 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">'+
                                            '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"/>'+
                                        '</svg>'+
                                        '<span>复制</span>'+
                                    '</a>'+
                                    // '<a class="dropdown-item d-flex align-items-center text-danger" href="javascript:void(0)" onclick="deleteMsg()">'+
                                    //     '<svg class="hw-18 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">'+
                                    //         '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>'+
                                    //     '</svg>'+
                                    //     '<span>删除</span>'+
                                    // '</a>'+
                                '</div>'+
                            '</div>'+
                        '</div>'+
                    '</div>';

            return str;
        }

        // 更新头部助理信息
        function renewAssistant(){
            $(".chat-header .media-body").find('h6').html(global_assistant.name);
            $(".chat-header .media-body").find('small').html(global_assistant.description);
            $(".chat-header .injectable").attr('src','__UPLOAD__/'+global_assistant.image);
        }

        // 发送消息
        function sendMsg(){
            var message = $.trim($("#msg_text").val());
            if (message == null || message == '') {
                cchUtil.message('请输入内容','danger');
                return false;
            }
            var curdate = getFamtterDate();
            if ($("[data-label='"+curdate+"']").length == 0) {
                var str = '<div class="message-day">'+
                            '<div class="message-divider sticky-top pb-2" data-label="'+curdate+'">&nbsp;</div>'+
                        '</div>';
                $("#chatContent").append(str);
            }

            var str = createMsgHtml(message,0);
            $("[data-label='"+curdate+"']").parent().append(str);

            var str = createMsgHtml('AI思考中......',2);
            $("[data-label='"+curdate+"']").parent().append(str);

            $("#msg_text").val('');
            scrollBottom();

            

            $.ajax({
                url:'{:url("msg/chatapi")}',
                type:'post',
                data:{session_sn:global_assistant.session_sn,message:message},
                dataType:'json',
                success:function(response){
                    var reply = response.data;
                    var str = createMsgHtml(reply,1);
                    $("[data-label='"+curdate+"']").parent().append(str);
                    $(".msg_loading").remove();
                    scrollBottom();
                },
                error: function(err) {
                    var str = createMsgHtml('AI异常，请重试',1);
                    $("[data-label='"+curdate+"']").parent().append(str);
                    $(".msg_loading").remove();
                    scrollBottom();
                }
            });
        }

        // 显示用户信息
        function showUinfo(){
            $.ajax({
                url:'{:url("user/read")}',
                type:'post',
                dataType:'json',
                success:function(response){
                    data = response.data;
                    console.log(data)
                    $("#nickname").val(data.nickname);
                    $("#truename").val(data.truename);
                    $("#mobile").val(data.mobile);
                    $("#birthday").val(data.birthday);
                    $("#email").val(data.email);
                    $("#company").val(data.company);
                    $("#signature").val(data.signature);

                    $("#info_nickname").html(data.nickname);
                    $("#info_truename").html(data.truename);
                    $("#info_mobile").html(data.mobile);
                    $("#info_birthday").html(data.birthday);
                    $("#info_email").html(data.email);
                    $("#info_company").html(data.company);
                    $("#info_signature").html(data.signature);
                }
            });
        }

        // 对话滚动到底部
        function scrollBottom(){
            var scrollHeight = $('#chatContent').parent().prop("scrollHeight");
            $('#chatContent').parent().scrollTop(scrollHeight,200);

            var clipboard = new ClipboardJS('.copy_btn'); //先实例化
            clipboard.on('success', function(e) {
                cchUtil.message('复制成功');
                e.clearSelection();
            });
            clipboard.on('error', function(e) {
                alert('复制失败'); // 复制失败的事件
            });
        }




    </script>

</body>

</html>